<template>
    <div>
        <template v-if="isDefault">
            <TemplatePPT :menuId="menuId" :onCallBackChange="changeDef"></TemplatePPT>
        </template>
        <template v-else>
            <PPTList :menuId="menuId" :onCallBackChange="changeDef"></PPTList>
        </template>
    </div>
</template>
<script>
import TemplatePPT from './components/ppt/TemplatePPT.vue';
import PPTList from './components/ppt/PPTList.vue';

export default {
    name: 'PPTWrap',
    components: {
        TemplatePPT,
        PPTList,
    },
    props: {
        menuId: {
            type: [String, Number],
            default: '',
        }
    },
    data() {
        return {
            isDefault: true,
        }
    },
    methods: {
        changeDef() {
            this.isDefault = !this.isDefault;
        },
    },
    watch: {
        isDefault: {
            handler(nVal, oVal) {
                let res = '西联昼夜安全评价';
                // if (!nVal) {
                //     res = '集团公司（港报）曝光问题'
                // }
                this.$bus.$emit("headInfo", res, true);
            }
        }
    }
}
</script>
<style lang="less" scoped></style>